package com.ruoyi.train.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.train.mapper.SysUserTrainMapper;
import com.ruoyi.train.domain.SysUserTrain;
import com.ruoyi.train.service.ISysUserTrainService;

/**
 * 培训管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-29
 */
@Service
public class SysUserTrainServiceImpl implements ISysUserTrainService 
{
    @Autowired
    private SysUserTrainMapper sysUserTrainMapper;

    /**
     * 查询培训管理
     * 
     * @param id 培训管理ID
     * @return 培训管理
     */
    @Override
    public SysUserTrain selectSysUserTrainById(Long id)
    {
        return sysUserTrainMapper.selectSysUserTrainById(id);
    }

    /**
     * 查询培训管理列表
     * 
     * @param sysUserTrain 培训管理
     * @return 培训管理
     */
    @Override
    public List<SysUserTrain> selectSysUserTrainList(SysUserTrain sysUserTrain)
    {
        return sysUserTrainMapper.selectSysUserTrainList(sysUserTrain);
    }

    /**
     * 新增培训管理
     * 
     * @param sysUserTrain 培训管理
     * @return 结果
     */
    @Override
    public int insertSysUserTrain(SysUserTrain sysUserTrain)
    {
        sysUserTrain.setCreateDate(DateUtils.getNowDate());
        return sysUserTrainMapper.insertSysUserTrain(sysUserTrain);
    }

    /**
     * 修改培训管理
     * 
     * @param sysUserTrain 培训管理
     * @return 结果
     */
    @Override
    public int updateSysUserTrain(SysUserTrain sysUserTrain)
    {
        sysUserTrain.setUpdateDate(DateUtils.getNowDate());
        return sysUserTrainMapper.updateSysUserTrain(sysUserTrain);
    }

    /**
     * 批量删除培训管理
     * 
     * @param ids 需要删除的培训管理ID
     * @return 结果
     */
    @Override
    public int deleteSysUserTrainByIds(Long[] ids)
    {
        return sysUserTrainMapper.deleteSysUserTrainByIds(ids);
    }

    /**
     * 删除培训管理信息
     * 
     * @param id 培训管理ID
     * @return 结果
     */
    @Override
    public int deleteSysUserTrainById(Long id)
    {
        return sysUserTrainMapper.deleteSysUserTrainById(id);
    }
}
